package com.heaven.guava;

import com.google.common.collect.Lists;
import java.util.LinkedList;
import java.util.List;

public class GuavaCollections {
    public static void main(String[]args){
        new GuavaCollections().testLists();
    }
    public void testLists(){
        LinkedList<Integer> list = Lists.newLinkedList();
        for(int i=0;i<99;i++){
            list.add(i);
        }
        List<List<Integer>> lists = Lists.partition(list, 10);
        for(List<Integer> subList : lists){
            this.printList(subList);
        }
    }

    public <T> void printList(List<T> list){
        for(T t : list){
            System.out.print(t+" ");
        }
        System.out.println();
    }
}

